﻿using System;
using System.Web;


using ns_User;
namespace ns_SessionManage
{
    public static class c_SessionManage
    {
        private const String USER_NAME = "NAME";

        public static void SaveLoginUser(c_User user)//保存登陆用户
        {
            Put(USER_NAME,user);
        }
        public static c_User GetLoginUser()//获取用户变量
        {
            return Get<c_User>(USER_NAME);
        }


        private static void Put(String keyword, Object obj)
        {
            HttpContext.Current.Session[keyword] = obj;
        }
        private static T Get<T>(String keyword)
        {
            return (T)HttpContext.Current.Session[keyword];
        }
    }
}